package com.kamistoat.meimeimall.meimeimallproduct.feign;

import com.kamistoat.meimeimall.common.To.EsTo.SpuUpTo;
import com.kamistoat.meimeimall.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient("meimeimall-search")
public interface SearchFeignService {
    /**
     * 远程调用ES接口，向ES保存数据
     * @param spuUpToList spuUpTo列表
     * @return R
     */
    @RequestMapping("/search/save/spuUpToES")
    R spuUpToES(@RequestBody List<SpuUpTo> spuUpToList);

    /**
     * 远程调用ES接口，从ES中删除数据
     * @param skuIdList 要删除的sku商品id列表
     * @return R
     */
    @RequestMapping("/search/save/spuDownToES")
    R spuDownToES(@RequestBody List<Long> skuIdList);
}